package com.ydj.app.entity.query;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ydj.app.entity.Banner;
import com.ydj.app.enumerate.MemberLevelEnum;
import com.ydj.framework.mysql.BaseQuery;
import com.ydj.framework.mysql.MysqlSort;

import java.util.List;

public class BannerQuery extends BaseQuery<Banner> {
    public BannerQuery(IService<Banner> service) {
        super(service);
    }

    public BannerQuery id(Long id) {
        eq(Banner::getId, id);
        return this;
    }

    public BannerQuery ids(List<Long> value) {
        in(Banner::getId, value);
        return this;
    }

    public BannerQuery enable(Boolean value) {
        eq(Banner::getEnable, value);
        return this;
    }

    public BannerQuery orderByOrderNumberAsc() {
        orderBy(Banner::getOrderNumber, MysqlSort.ASC);
        return this;
    }

    public BannerQuery orderByOrderNumberDesc() {
        orderBy(Banner::getOrderNumber, MysqlSort.DESC);
        return this;
    }
    public BannerQuery memberLevelContains(MemberLevelEnum value) {
        jsonContains(Banner::getMemberLevelJson, value);
        return this;
    }
}